package dtaskboard.client.util;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;

public class OpenDialogButton extends Button implements ClickHandler {

  private final DialogBox dialog;

  public OpenDialogButton(String label, DialogBox dialog) {
    this.addClickHandler(this);
    this.dialog = dialog;
    this.setText(label);
  }



  @Override
  public void onClick(ClickEvent event) {
    this.dialog.show();
    this.dialog.center();
  }
}
